<extend name="./public/frame.html"/>
<block name="content">
    <!--<form class="layui-form">-->
        <div class="layui-collapse">
            <div class="layui-colla-item" lay-filter="driver">
                <h2 class="layui-colla-title" data-v="driver">提现信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table layui-form">
                        <volist name="fields" id="vo">
                            <tr>
                                <td>{$vo}</td>
                                <td>
                                    <if condition="$key eq 'abnormal_des'">
                                        <ol>
                                            <volist name="$info['abnormal_des']" id="v">
                                                <li>{$v}</li>
                                            </volist>
                                        </ol>
                                        <else/>
                                        {$info[$key]}
                                    </if>
                                </td>
                            </tr>
                        </volist>

                        <tr>
                            <td>是否通过</td>
                            <td>
                                <input type="checkbox" data-id="" value="9" lay-skin="switch" lay-text="是|否" lay-filter="is_use">
                                <input type="text" name="audit_status" id="audit_status" value="9" hidden>
                            </td>
                        </tr>

                        <tr>
                            <td>审核备注(<span style="color: red;">必填</span>)</td>
                            <td>
                                <div class="layui-form-item layui-form-text">
                                    <div class="layui-input-block">
                                        <textarea placeholder="请输入内容" class="layui-textarea" id="remark"></textarea>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-row" style="text-align:center">
                <input type="hidden" id="cash_id" value="{$info['id']}"/>
                <button class="layui-btn" style="margin-bottom: 22px;" lay-submit="" lay-filter="submit" id="submits">
                    确认审核
                </button>
            </div>
        </div>
    <!--</form>-->
    <script>
        layui.use(['layer','form','table','element'], function () {
            var layer = layui.layer,
                table = layui.table,
                form = layui.form;

            //监听启用/停用操作
            form.on('switch(is_use)', function(obj){
                var check = obj.elem;
                var value = obj.value;
                var audit_status = $('#audit_status');

                switch(value){
                    case '1':
//                        auth.show().children('td').children('textarea').attr('lay-verify','required');
                        $(check).prop('checked',obj.elem.checked).val('9');
                        audit_status.val('9');
                        form.render('checkbox');
                        break;
                    case '9':
                        //auth.hide().children('td').children('textarea').attr('lay-verify','');
                        $(check).prop('checked',obj.elem.checked).val('1');
                        audit_status.val('1');
                        form.render('checkbox');
                        break;
                    default:
                        break;
                }
            });

            $(document).on('click', '#submits', function () {
                var remark = $('#remark').val();
                if (remark == '') {
                    layer.alert('审核备注不能为空');
                    return false;
                }
                var id = $('#cash_id').val();
                var audit_status = $('#audit_status').val();


                layer.confirm('确认审核？！', function (index) {
                    $.post('/admin/driver_wind/submits', {'id': id, 'remark': remark, 'audit_status': audit_status}, function (res) {
                        switch (res['code']) {
                            case 1:
                                layer.msg(res['msg'], {icon: 1});
                                parent.window.location.reload();
                                break;
                            default:
                                layer.msg(res['msg'], {icon: 5});
                                break;
                        }
                    }, 'json');
                    layer.close(index);
                });
            })





        });
    </script>

</block>